FROM ai.internal/library/pytorch:1.9.0-cuda11.1-cudnn7-runtime

RUN apt-get update && apt-get install -y git vim

RUN pip install tensorboardX==1.6.0
RUN mkdir -p /opt/mnist

WORKDIR /opt/mnist/src
ADD src/mnist.py /opt/mnist/src/mnist.py

#RUN mkdir -p /opt/mnist/data/FashionMNIST/raw

#http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/train-images-idx3-ubyte.gz
ADD train-images-idx3-ubyte.gz /opt/mnist/data/FashionMNIST/raw/
ADD train-labels-idx1-ubyte.gz /opt/mnist/data/FashionMNIST/raw/
ADD t10k-labels-idx1-ubyte.gz /opt/mnist/data/FashionMNIST/raw/
ADD t10k-images-idx3-ubyte.gz /opt/mnist/data/FashionMNIST/raw/

RUN  gzip -d /opt/mnist/data/FashionMNIST/raw/*

RUN  chgrp -R 0 /opt/mnist \
  && chmod -R g+rwX /opt/mnist

ENTRYPOINT ["python", "/opt/mnist/src/mnist.py"]
